package day_807;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

import org.junit.Test;

import day_803.StudentDome;
import day_806.Test1;

public class FanShe {
	public void test() {
		Class clazz = person.class;

	}

	@Test
	public void test1() throws Exception {
		Class clazz = person.class;
		Constructor constructor = clazz.getConstructor(String.class, Integer.class);
		System.out.println(constructor);
		person person = (person) constructor.newInstance(new Object[] { "张三", 20 });
		System.out.println(person);
		// day_807.person student=new person("张三啊",18);
		// student.toString();

	}

	@Test
	public void test2() {
		try {
			Class class1 = Class.forName("day_807.person");
			Method[] methods = class1.getMethods();
			for (Method method : methods) {
				System.out.println(method);
			}
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}

	}
	@Test
	public void test3(){
		try {
			Class class1=Class.forName("day_807.person");
			Method[] methods=class1.getMethods();
			for (Method method : methods) {
				System.out.println(method);
			}
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		
		
		
		
		
		
		
	}
}
